package com.wuseguang.springcloud.dao.repository;

import com.wuseguang.springcloud.entity.EnrolledStudents;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;

import javax.transaction.Transactional;

public interface EnrolledStudentsRepository  extends JpaRepository<EnrolledStudents,Integer> {

    @Transactional
    @Modifying
    @Query(value = "DELETE FROM `enrolled_students` WHERE `activity_id` = ?1",nativeQuery = true)
    Integer deletecByActivityId(Integer id);
}
